<script setup>
import router from '@/router';
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import groupDetailMemberPie from './groupDetailMemberPie.vue'
const emits = defineEmits(['setTitle'])
emits('setTitle', '群聊信息')

// 动态显示列表
const route = useRoute()
const groupId = ref(route.query.groupId)
router.beforeEach((to, from, next) => {
    groupId.value = to.query.groupId
    next()
})

//群介绍是否显示
const isShowGroupIntro = ref(false)

//群公告是否显示
const isShowAnnouncement = ref(false)

</script>

<template>
    <div class="contaner-box">
        <div class="friend-detail-wrapped-box">
            <div class="header-box">
                <el-avatar class="left-avatar" :size="100" src="/src/assets/image/OIP-C.jpeg" />
                <div class="right-info-box">
                    <div class="info-deatil">
                        <div class="nick-name">这是群号为{{ groupId }}的群聊</div>
                        <div class="forest-id">
                            群号: GROUP00{{ groupId }}
                            <span class="iconfont icon-fuzhi" @click="$copy('GROUP00' + groupId)"></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="main-tool-wrapper-box">
                <div class="cell-box">
                    <div class="left-tool-name-box">
                        <span class="iconfont icon-box icon-beizhu"
                            style="font-size:13px;font-weight: 700;color: #555;"></span>
                        <span class="text overflow-text">群备注</span>
                    </div>
                    <div class="extend-box forest-active overflow-text">这是备注为{{ groupId }}的群</div>
                </div>
                <div class="cell-box">
                    <div class="left-tool-name-box">
                        <span class="iconfont icon-box icon-geren" style="font-weight: 700;color: #444;"></span>
                        <span class="text overflow-text">我在本群昵称</span>
                    </div>
                    <div class="extend-box forest-active overflow-text">前端练习时长两年半</div>
                </div>
                <div class="cell-box">
                    <div class="left-tool-name-box overflow-text">
                        <span class="iconfont icon-box icon-guizewendang"
                            style="font-size:16px;font-weight: 700;color: #555;"></span>
                        <span class="text overflow-text">群介绍</span>
                    </div>
                    <div class="extend-box forest-active overflow-text" @click="isShowGroupIntro = !isShowGroupIntro">
                        一起探讨前端知识搞钱钱！
                        <el-icon>
                            <ArrowRight />
                        </el-icon>
                    </div>

                    <el-dialog v-model="isShowGroupIntro" :title="`这是备注为${groupId}的群 — 群介绍`" width="800" draggable>
                        <span>一起探讨前端知识搞钱钱！</span>
                    </el-dialog>
                </div>
                <div class="cell-box">
                    <div class="left-tool-name-box">
                        <span class="iconfont icon-box icon-guangbo"
                            style="font-size:17px;font-weight: 700;color: #555;"></span>
                        <span class="text overflow-text">群公告</span>
                    </div>
                    <div class="extend-box forest-active" @click="isShowAnnouncement = !isShowAnnouncement">
                        <span class="overflow-text">本群是聊天学习的群，群里面禁止发布一些违法犯罪的信息。禁止黄赌毒</span>
                        <el-icon>
                            <ArrowRight />
                        </el-icon>
                    </div>
                    <el-dialog v-model="isShowAnnouncement" :title="`这是备注为${groupId}的群 — 群公告`" width="800" draggable>
                        <span>本群是聊天学习的群，群里面禁止发布一些违法犯罪的信息。禁止黄赌毒</span>
                    </el-dialog>
                </div>
                <div class="forest-community-tool-box">
                    <div class="cell-box">
                        <div class="left-tool-name-box">
                            <span class="iconfont icon-box icon-fenzu"
                                style="font-size:14px;font-weight: 700;color: #555;margin-left: 1px;"></span>
                            <span class="text overflow-text">群成员 (8人)</span>
                        </div>
                        <div class="extend-box">
                            <span class="look-cheng-yuan forest-active">查看</span>
                            <el-icon>
                                <ArrowRight />
                            </el-icon>
                        </div>
                    </div>
                    <div class="contaner-box-content">
                        <div class="avatar-box">
                            <el-avatar :size="38" src="/src/assets/image/20200219184554_wwnvh.jpg" class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src="https://tse4-mm.cn.bing.net/th/id/OIP-C.5zdMEWczpI1r1V93yHgZPQAAAA?w=211&h=211&c=7&r=0&o=5&dpr=1.3&pid=1.7"
                                class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src="https://tse2-mm.cn.bing.net/th/id/OIP-C.wk8Qob1shSazjYdxC3bw2gAAAA?w=211&h=211&c=7&r=0&o=5&dpr=1.3&pid=1.7"
                                class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src="https://tse3-mm.cn.bing.net/th/id/OIP-C.7ucdAki8h_JKuI1ahpMNZAAAAA?w=211&h=211&c=7&r=0&o=5&dpr=1.3&pid=1.7"
                                class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src="https://tse3-mm.cn.bing.net/th/id/OIP-C.0TuH0Yxo3P9mjbvhSDMNgwAAAA?w=147&h=180&c=7&r=0&o=5&dpr=1.3&pid=1.7"
                                class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src="https://tse3-mm.cn.bing.net/th/id/OIP-C.hAJGtgEXnxcV22FC1KG6dQAAAA?w=89&h=89&c=1&rs=1&qlt=90&r=0&dpr=1.3&pid=InlineBlock"
                                class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src="https://tse3-mm.cn.bing.net/th/id/OIP-C.HkO7MAxd9Vsrs1zVxbRkEgAAAA?w=89&h=90&c=1&rs=1&qlt=90&r=0&dpr=1.3&pid=InlineBlock"
                                class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src="https://tse2-mm.cn.bing.net/th/id/OIP-C.xqFCKj_DmwNUx_g-LQ5KAQHaHa?w=147&h=180&c=7&r=0&o=5&dpr=1.3&pid=1.7"
                                class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src="https://tse4-mm.cn.bing.net/th/id/OIP-C.ApkTFDhbAiNzqjqR-12kEwHaHa?w=89&h=89&c=1&rs=1&qlt=90&r=0&dpr=1.3&pid=InlineBlock"
                                class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src="https://tse1-mm.cn.bing.net/th/id/OIP-C.2TklLhiZpJcsDj7JNIWaGQHaHa?w=89&h=90&c=1&rs=1&qlt=90&r=0&dpr=1.3&pid=InlineBlock"
                                class="avatar" />
                        </div>
                        <div class="avatar-box">
                            <el-avatar :size="38"
                                src=""
                                class="avatar" />
                        </div>
                    </div>
                </div>
                <div class="forest-community-tool-box">
                    <div class="cell-box">
                        <div class="left-tool-name-box">
                            <span class="iconfont icon-box icon-bingtu"
                                style="font-size:18px;font-weight: 700;color: #555;"></span>
                            <span class="text">成员分布</span>
                        </div>
                    </div>

                    <groupDetailMemberPie></groupDetailMemberPie>

                </div>
            </div>

            <div class="footer-bar-box-tool">
                <button class="forest-active">分享</button>
                <button class="forest-active">发消息</button>
            </div>
        </div>
    </div>
</template>
<style scoped>
.contaner-box {
    background-color: #fff;
    width: 100%;
    height: 100%;

    .friend-detail-wrapped-box {
        display: flex;
        width: 100%;
        height: 100%;
        flex-direction: column;
        padding: 0 30px;
        padding-top: 50px;
        background-color: #fff;
        color: #333;
        max-width: 600px;
        margin: 0 auto;

        .header-box {
            display: flex;
            border-bottom: 2px solid #F5F5F5;
            padding-bottom: 20px;

            .left-avatar {
                flex: none;
            }

            .right-info-box {
                color: var(--his-text-color);
                display: flex;
                align-items: center;
                flex: 1;
                justify-content: space-between;

                .info-deatil {
                    display: flex;
                    height: 100%;
                    padding-left: 20px;
                    flex-direction: column;
                    justify-content: center;

                    .nick-name {
                        font-size: 18px;
                        margin-bottom: 10px;
                    }

                    .forest-id {
                        color: #7F7F7F;
                        font-size: 13px;
                    }

                    .status-box {
                        position: relative;
                        padding-left: 16px;

                        .circle {
                            width: 13px;
                            height: 13px;
                            border-radius: 50%;
                            background-color: var(--my-online-color);
                            position: absolute;
                            top: calc(50% - 6.3px);
                            left: 0px;
                        }
                    }
                }
            }
        }

        .main-tool-wrapper-box {
            .cell-box {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-top: 20px;

                .left-tool-name-box {
                    display: flex;
                    align-items: flex-end;
                    line-height: 19px;
                    height: 20px;
                    /* width:30%; */


                    .iconfont {}

                    .icon-box {
                        font-size: 14px;
                        margin-right: 5px;
                    }

                    .icon-beizhu {}

                    .text {}
                }


                .extend-box {
                    display: flex;
                    align-items: center;
                    justify-content: flex-end;
                    width: 70%;

                    .look-cheng-yuan {
                        font-size: 14px;
                        color: #7F7F7F;
                    }
                }
            }
        }

        .forest-community-tool-box {
            user-select: none;
            margin-top: 20px;

            .cell-box {}

            .member-pie-box {
                height: 128px;
                width: 100%;
            }

            .member-pie-box {}

            .contaner-box-content {
                padding: 15px 0;
                padding-bottom: 0;
                display: flex;
                flex-wrap: wrap;

                .avatar-box {
                    display: inline-block;
                    height: 38px;
                    width: 38px;
                    position: relative;
                    margin-right: 10px;
                    margin-bottom: 10px;

                    &:first-child {
                        margin-right: 20px;

                        &::before {
                            content: "";
                            width: 2px;
                            border-radius: 100px;
                            height: 30px;
                            background-color: #F2F2F2;
                            position: absolute;
                            right: -10px;
                            top: 4px;
                        }
                    }



                    .avatar {
                        margin-right: 10px;
                    }
                }

            }

            .forest-active:hover {
                color: var(--my-frame-color);
                transition: all 0.3s;
            }
        }

        .footer-bar-box-tool {
            display: flex;
            align-items: center;
            margin-top: 50px;
            justify-content: center;

            button {
                display: flex;
                justify-content: center;
                align-items: center;
                background-color: transparent;
                border: 1px solid #CCCCCC;
                padding: 5px 38px;
                margin-right: 15px;
                font-size: 14px;
                border-radius: 5px;

                &:last-child {
                    background-color: var(--my-frame-color);
                    color: white;
                    border-color: var(--my-frame-color);
                }
            }
        }
    }
}
</style>